package com.example.love_margin.Mapper.configuer;



public class SelectPets {

    public String selectManyKey(String pet_category,String pet_varieties,String pet_sex){
        StringBuffer  sqlMap = new StringBuffer ();
        String map = "SELECT * FROM pet WHERE 1=1";
        sqlMap.append(map);
        if(!"".equals(pet_category)&&pet_category!=null){
            sqlMap.append(" AND pet_category = ").append("'").append(pet_category).append("'");
        }
        if (!"".equals(pet_varieties)&&pet_varieties!=null){
            sqlMap.append(" AND pet_varieties = ").append("'").append(pet_varieties).append("'");
        }
        if (!"".equals(pet_sex)&&pet_sex!=null){
            sqlMap.append(" AND pet_sex = ").append("'").append(pet_sex).append("'");
        }
//        System.out.println(sqlMap);
        return sqlMap.toString();
    }


}
